#!/usr/bin/env python
#-*- coding:gbk -*-
'''
@file makegcov.py
@brief 
@author hulei
@version 1.0
@date 2012-06-19
@copyright 2012 Hulei. All rights reserved.
'''

import os, sys
import argparse

def main():
    parser = argparse.ArgumentParser(description='makegcov')
    parser.add_argument('-o', action='store', type=str, dest='objpath', help='set object path')
    ns = parser.parse_known_args(sys.argv[1:])[0]
    for f in os.listdir(ns.objpath):
        if f.endswith('.o'):
            os.system('gcov %s %s' % (' '.join(sys.argv[1:]), f[:-2]))

if __name__ == '__main__':
    main()
